function changeFace() {
        var reader = new FileReader();//定义文件读取流对象
        reader.readAsDataURL(document.getElementById("fileTxt").files[0]);
        reader.onload = function (ev) {
            document.getElementById("faceImg").src = ev.target.result;
        }
}
async function add() {
    var formObj=new FormData;
    // formObj.append("uploadImg",$("fileTxt").files[0]);
    // let config = {
    //     headers: {'Content-Type': 'multipart/form-data' }
    // }
    // var uploadFileName;
    // //向服务器上传文件，得到上传文件名
    // await axios.post("upload",formObj,config).then(resp=>{
    //     uploadFileName=resp.data;
    // })
    // alert(uploadFileName);
    axios.get("/em/add",{
        params:{
            name:$("nameTxt").value,
            phone:$("phoneTxt").value,
            money:$("moneyTxt").value,
            imgPath:uploadFileName

        }
    }).then(resp=>{
        // alert(resp.data);
        var info=resp.data;
        if (info=="ok"){
            location.href="/main.html"
            formObj.append("uploadImg",$("fileTxt").files[0]);
        }else {
            info.forEach(n=>{
                $(n.field+"Span").innerHTML=n.defaultMessage;
            });
            $("faceImgSpan").innerHTML="验证失败，图片未上传";
            $("faceImgSpan").style.color="red";
            $("faceImgSpan").style.fontSize="14px";

        }
    })
    let config = {
            headers: {'Content-Type': 'multipart/form-data' }
        }
        var uploadFileName;
        //向服务器上传文件，得到上传文件名
        await axios.post("upload",formObj,config).then(resp=>{
            uploadFileName=resp.data;
        })
}